package com.jbit.dm212.config;

import java.io.FileWriter;
import java.io.IOException;
public class AlipayConfig {
    //↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "9021000129691851";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCjbVH1PGTam12wjJMAK9kHOBnSAZQ16/Aes2Zl7eFx+GKo5ZD3Z+Mo+5tpS+/XnSSubGNNcUGre2LJ38wxQuMcPrS2mtlxNTxFZJMyBFc6TEs+CewzEp9C3+ZjGWkcazgEYRrzVFRXgU+StyLv6V2XEijSl+mX5WdHoAmmsNn6NkJH7Uy38PJnJoJOYijcsRSdzn+JFxNtAXlklnYk4VwbM9chuVGM7kadO02eFlTw6shGXls0dTeGLfCQwr24+LhYrCCizoOHWdIjz8gWZUWGTG1UhEwiU3iq5dgb9syoNy6+vsFFAwoWJW6ppGitytOwRSoj+bS/W4RKiQlQp22NAgMBAAECggEAOA/+d5Q6PMvjffcbTom8L7/NC7/C6iSAAOgmDn1mQ0SkA7CM5HJc+OgnTh3grySXOsav4hciIgN3xizhzVxWsI/KSoIgabeLb3qrDBN1IOifPy8EOhj/TV+llwVWi4s0cjwllKevLz2K4Je2gnqZwoNWQbgfSB5IKcf6x5YPkMeTnY3BTduyJDCp7aKlL+M8psDNgptSKn02q9a3lRuP8mBSKWEZADryNbZCuIfxfL2J8egMQ3zT/RbC8QxFwAcWBFkmSyHhuO3s5sz4U1L78DHxEOVQQ5xbM92ntGz5ZuXVCpuhFhShx+n/7I+mYesJpoRzXOxsoXg6zqfNLVrlAQKBgQDadR5OKa1RvW0peusZRLMu8hflk/yj29ViinaJH5mrkSgWeOo3glhw9ed4XecwsDGFGmQjQSrOAuwUS5KSTJY6jdcNsPHrQpKC41sVFA7uZC2OM+eS67YsLdSmB4bXYmhgO/3ssmfeWt4wlKi8jFmDyFWi6PtkEwBVs+QUfFiALQKBgQC/gy0EezbCqmASivJk8ZoNAE0iD2uXvf+B/Zz7tjJLA7NLCUmBpZti6W8zwLwK8YE7KWdwjGi64mXGOjhb7Zf2tGjeVYpfKmNELOrcC0uTpw1vb22LuTzdiD1EjGbfkhvUCi5mAmIOR2KSqEnpjnHLmG5m/Wphu2ZcWomVja+e4QKBgBv+UgnWEV2eFnTwSVwNj6B+aU2D7yXYL7nW4GWl5P01NpvalrjSPR8Mg8LK1atJiK7zuM1DtoZ7nWDkZj3VDpMmRd59RCLPfxLCq5NB5L/rmmLUh+ItzkRPAybbZA4JkDJ0vY8tNV4q6rny8sRmf7oBW+fqTvx96tcQnDN706NpAoGAde/rPjI+w9y2M1Ub9uwOKWmBFrOWV6kq+ztafGx0RlvuAwyiFtQMf/ovgBh19OtK4UsbJ2VgbY5UjKF36azEg6oQVrMo9ngdD3P14jKWhUQ/8tsVBBG8GNT4ngk0pQPOXWMztaBMEG0HmDdI5SrSi0XA3226IJuOattalR3fBCECgYBmGu2BW5L56sO/f+b/H3YbGzPkzNXJBtwPcvEZWF9eSa+1Tv/g4PktpUxj/oYzKZ3KkwZ0Bl9KKb0BKtrCvYjL5E9mazNspwPAcg+gy8x0DZ14Xe5QtEStuEebpyx5XIRFHr6wh5j4KoXxeCXYSoL5dh4crAnBMRlxBCFVY/+eWw==";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAkN/9ttFOagqlAqP+X60PgdZUBM3MDl7bsFZDZbanXxMaU5IThv27GA9vnWvyWKrTjCmR1OPLZq+C4NP9Xpyg9W5PI/bNQ7Q8fK4wyroUtE6SpnYgILCWn9d1NqODTnryIBjfGPKUHi10Whqc5dyY6iuixWa6G19FAusb8W+Q+TzCI8clmrZFeDIdeLRpbBFaLaH2zPfI1m4sj2+ZR2KJQp9uw/Yv2Gf+FUXHqEHljxRNffXPe904PGi0NPWEhlbwzCReapy1aASJwugO1P8th8qqJtVfouoxwS6Rr5DAu0spzH05kt71GTdlWcpPq2dWCy7Mwkn2ZxYevU2r8WPpXwIDAQAB";


    //post 需要一个专门的服务器去接收
    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://localhost:7600/pay/api/p/tradesuccess";

    //get 直接可以跳转当前项目的页面
    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://localhost:7600/pay/api/p/tradesuccess";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi-sandbox.dl.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
